package org.coolsugar.mybatis.controller;

import java.util.List;

import org.coolsugar.mybatis.mapper.UserMapper;
import org.coolsugar.mybatis.pojo.User;
import org.coolsugar.mybatis.service.MybatisService;
import org.coolsugar.mybatis.vo.RetCount;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MybatisController {
	@Autowired
	private MybatisService service;
	
	@RequestMapping("/query")
	@ResponseBody
	public List<User> queryAll() {
		List<User> list = service.queryAll();
		
		return list;
	}
	
	@RequestMapping("/queryCount")
	@ResponseBody
	public RetCount queryCount() {
		RetCount ret = service.queryCount();
		
		return ret;
	}
}
